package com.bstek.controller;

import com.bootdo.clouddocommon.utils.PageUtils;
import com.bootdo.clouddocommon.utils.Query;
import com.bootdo.clouddocommon.utils.R;
import com.bstek.model.domain.Checkin;
import com.bstek.service.CheckinService;
import org.springframework.web.bind.annotation.*;

import javax.inject.Inject;
import java.util.List;
import java.util.Map;

@RestController
public class CheckinController {

    @Inject
    CheckinService checkinService;

    @GetMapping("getCheckinData")
    public PageUtils getCheckinData(@RequestParam  Map<String, Object> params){
        Query query = new Query(params);
        List<Checkin> checkins =  checkinService.getCheckinData(query);
        int total = checkinService.count(query);
        PageUtils pageUtil = new PageUtils(checkins, total);
        return pageUtil;
    }

}
